<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8" />
  <title>Simple REST SOE with capabilities</title>
  <style>
    table, th, td {
      border: 1px solid black;
      border-collapse: collapse;
    }
    th, td {
      padding: 5px;
    }
    th {
      font-weight: bold;
    }
  </style>
</head>
<body>
  ## Simple REST SOE with capabilities

  <div xmlns="http://www.w3.org/1999/xhtml">The purpose of this sample is to show the capabilities of a server object extension (SOE). </div>
  <div xmlns="http://www.w3.org/1999/xhtml"> </div>
  <div xmlns="http://www.w3.org/1999/xhtml">This sample SOE has two subresources, busstations and trainstations, and two operations, findBusStationId and findTrainStationId. It also has two capabilities: Bus Services and Train Services. The Bus Services capability controls access to the busstations subresource and the findBusStationById operation, while the Train Services capability controls access to the trainstations subresource and<font size="2"> the findTrainStationById operation.</font></div>  

```
Language:              C#
Subject:               Server
Organization:          Esri, http://www.esri.com
Date:                  10/17/2019
ArcObjects SDK:        10.8
Visual Studio:         2017, 2019
.NET Target Framework: 4.5
```

### Resources

* [ArcObjects .NET API Reference online](http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm)  
* [Sample Data Download](../../releases)  
* [What's new](http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#91cabc68-2271-400a-8ff9-c7fb25108546.htm)  
* [Download the ArcObjects SDK for .Net from MyEsri.com](https://my.esri.com/)  

### Usage
#### Using this sample  
1. Deploy the NetSimpleRESTSOEWithCapabilities.soe file to the server.   
1. Enable the SOE on a map service of your choice. Ensure that the map service has at least one feature layer and one raster layer.  
1. After the map service has started with the SOE enabled on it, open the Services Directory and access the http://<server name>:6080/arcgis/rest/services page.  
1. Click the map service on which you enabled your SOE.  
1. Scroll down and click NetSimpleRESTSOEWithCapabilities listed in the Supported Extensions section. If your REST SOE isn't listed here, log in to the Services Directory as an administrator and clear the cache. Repeat steps 3, 4, and 5 as needed.  
1. The NetSimpleRESTSOEWithCapabilities web page displays the root resource details, such as name and description, along with the Child Resources and Supported Operations sections.  
1. Click the layers subresource. It displays information about all the feature layers in JSON format.   
1. Log in to ArcGIS Manager and edit the map service on which you enabled the SOE. On the map service's editing page, click Capabilities, then click Simple REST SOE With Capabilities. A section called Operations Allowed will appear below the SOE. Check the BusServices check box. Click the Save and Restart button.  
1. Open the SOE page in the Services Directory again and click the NumberOfBusStations subresource. This subresource will display a number of bus stations, confirming this subresource is accessible.  
1. Navigate back to the SOE page and click findBusStationById. Provide text in the busStationId text box and click the findBusStationById button. The text you entered in the text box will be displayed, confirming this operation is accessible.  
1. Access the NumberOfTrainStations subresource and findTrainStationById operation. In each case, the SOE will return an error message indicating that these are inaccessible. This is because the TrainServices capability is not enabled on this SOE.  
1. Log in to ArcGIS Manager, edit the map service, select ".Net Simple REST SOE With Capabilities", and enable the TrainServices capability. Test your access to the NumberOfTrainStations subresource and findTrainStationById operation. You'll find that these are now accessible.   

---------------------------------

#### Licensing  
<table><tr><th> Development licensing </th><th> Deployment licensing </th></tr>
<tr><td>  </td><td>  </td></tr>  
</table>
</body>
</html>